package com.tl.mq.rabbit_mq;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class RabbitMqConsumer {

    // 消费队列
    @RabbitListener(queues = {"img"})
    public void receiver(String msg){
        System.out.println("消费数据：" + msg);
    }


    // 消费队列 topic + with
    @RabbitListener(queues = {"img_topic"})
    public void receiverTopic(String msg){
        System.out.println("消费数据：" + msg);
    }


    // 消费队列 fanout + everyone
    @RabbitListener(queues = {"img_fanout"})
    public void receiverFanout(String msg){
        System.out.println("消费数据：" + msg);
    }



}
